package com.papers.system.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.papers.common.core.mapper.BaseMapperPlus;
import com.papers.system.domain.TJuanKnowledge;
import com.papers.system.domain.bo.TJuanKnowledgeBo;
import com.papers.system.domain.dto.TJuanKnowledgeDto;
import com.papers.system.domain.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 知识点Mapper接口
 *
 * @author papers
 * @date 2022-10-08
 */
public interface TJuanKnowledgeMapper extends BaseMapperPlus<TJuanKnowledgeMapper, TJuanKnowledge, TJuanKnowledgeVo> {

    Page<TJuanKnowledgeVo> getKnowledgeByPage(@Param("page") Page<TJuanKnowledgeVo> page, @Param("dto") TJuanKnowledgeDto dto);

    /**
     * 查询知识点树
     *
     * @param chapterId
     * @return
     */
    List<TJuanLeftTreeVo> getKnowledgeTreeList(@Param("id") String chapterId);

    /**
     * 查询知识点list
     *
     * @param bo
     * @return
     */
    List<TJuanKnowledgeVo> queryKnowledgeList(@Param("dto") TJuanKnowledgeBo bo);

    /**
     * 根据知识点id获取子id列表
     *
     * @param id 知识点id
     * @return 子id列表
     */
    List<String> queryChildIdsById(@Param("id") String id);

    List<TJuanKnowledgePutVo> outputKnowledge(@Param("list") List<String> chapterList);

    List<String> selectCodeList(@Param("bo") TJuanKnowledgeBo bo);

    List<TJuanKnowledge> selectByCourseId(String courseId);

    List<TJuanKnowledge> selectByChapterId(@Param("id") String chapterId);

}
